<%@page import="helpers.DateHelper"%>
<%@page import="models.TransactionModel"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="models.StoreItemModel"%>
<%@page import="java.util.List"%>
<%@page import="models.StoreModel"%>
<%
	StoreItemModel storeItem = (StoreItemModel) request.getAttribute("storeItemModel");
	List<TransactionModel> list = (List<TransactionModel>) request.getAttribute("list");
%>

<jsp:include page="/admin/layouts/header.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>

<script type="text/javascript" src="/admin/js/list_transaction.js"></script>

        <div class="maincontent noright">
        	<div class="maincontentinner">
            	
                <ul class="maintabmenu">
                	<li><a href="/admin/store-item/list/">Danh sách sản phẩm</a></li>
                	<li class="current"><a href="javascript: return false;">Lịch sử xuất nhập</a></li>
                </ul><!--maintabmenu-->
                
                <div class="content">
                	<div class="contenttitle radiusbottom0">
	                	<h2 class="table"><span>Lịch sử xuất nhập</span></h2>
	                </div>              
	                
	                <table cellspacing="0" cellpadding="0" border="0" class="stdtable stdtablecb" id="list-table">
	                    <colgroup>
	                        <col class="con0">
	                        <col class="con1">
	                        <col class="con0">
	                        <col class="con1">
	                        <col class="con0">
	                        <col class="con1">
	                        <col class="con0">
	                        <col class="con1">
	                        <col class="con0">
	                        <col class="con1">
	                        
	                    </colgroup>
	                    <thead>
	                        <tr>
	                        	<th class="head0">STT</th>
	                            <th class="head1">Deal</th>
	                            <th class="head0">Sản phẩm</th>
	                            <th class="head1">N/X</th>
	                            <th class="head0">SL DK</th>
	                            <th class="head1">SL Tổng nhập</th>	                            	                            
	                            <th class="head0">SL Tồn</th>
	                            <th class="head1">SL Đã giao</th>
	                            <th class="head0">SL Đang giao</th>
	                            <th class="head1">SL Nhập LOC</th>
	                            <th class="head0">Ngày XN</th>	  
	                            <th class="head1">SL XN</th>                                                                     
	                        </tr>
	                    </thead>
	                    <tfoot>
	                        <tr>
	                        	<th class="head0">STT</th>
	                            <th class="head1">Deal</th>
	                            <th class="head0">Sản phẩm</th>
	                            <th class="head1">N/X</th>
	                            <th class="head0">SL DK</th>
	                            <th class="head1">SL Tổng nhập</th>	                            	                            
	                            <th class="head0">SL Tồn</th>
	                            <th class="head1">SL Đã giao</th>
	                            <th class="head0">SL Đang giao</th>
	                            <th class="head1">SL Nhập LOC</th>
	                            <th class="head0">Ngày XN</th>	  
	                            <th class="head1">SL XN</th>                                                                                          
	                        </tr>
	                    </tfoot>
	                    <tbody>
	                    	<% for (int i = 0; i < list.size(); i++) { %>
	                        <tr>
	                        	<td class="center"><%=i+1 %></td>
	                        	<td class="center">[<%=storeItem.getDealId() %>]<%=storeItem.getDealName() %></td>
	                        	<td class="center">[<%=storeItem.getProductId() %>]<%=storeItem.getProductName() %></td>
	                            <td class="center"><% if(list.get(i).getType()==0) {out.print("X");} else {out.print("N");} %></td>
	                            <td class="center"><%=storeItem.getOrder() %></td>	                            
	                        	<td class="center"><%=storeItem.getAmount() %></td>
	                        	<td class="center"><%=list.get(i).getInventory() %></td>
	                        	<td class="center"><%=list.get(i).getDelivered() %></td>
	                        	<td class="center"><%=list.get(i).getDelivery() %></td>
	                        	<td class="center"><%=list.get(i).getLoc() %></td>	                        	
	                            <td class="center"><%=DateHelper.dateToString(list.get(i).getDate(),"HH:mm dd/MM/yyyy")%></td>
	                            <td class="center"><%=list.get(i).getAmount() %></td>	                            
	                        </tr>
	                        <% } %>
	                    </tbody>
	                </table>
                </div><!--content-->
                
            </div><!--maincontentinner-->
            
            <jsp:include page="/admin/elements/copyright.jsp">
            	<jsp:param name="language" value="1" />
			</jsp:include>
            
        </div><!--maincontent-->
        
<jsp:include page="/admin/layouts/footer.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>